package cn.tedu.exam1.exam.controller;

import cn.tedu.exam1.base.response.JsonResult;

import cn.tedu.exam1.exam.pojo.dto.CategoryQuery;
import cn.tedu.exam1.exam.pojo.dto.ExamQuery;

import cn.tedu.exam1.exam.pojo.vo.CategoryVO;
import cn.tedu.exam1.exam.pojo.vo.ExamVO;
//import cn.tedu.exam1.user.pojo.dto.UserSaveParam;
//import cn.tedu.ivos.user.pojo.dto.UserLoginParam;
import cn.tedu.exam1.exam.service.ExamService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/user")
public class ExamController {
    @Autowired
    ExamService examService;


    @GetMapping("select1")
    public JsonResult selectCategory(CategoryQuery categoryQuery){
        log.debug("后端开头");
        log.debug("查询用户:CategoryQuery={}",categoryQuery);
        List<CategoryVO> list = examService.selectCategory(categoryQuery);
        log.debug("list={}",list);
        log.debug("接受数据");
        return JsonResult.ok(list);
    }
    @GetMapping("select2")
    public JsonResult selectExam(ExamQuery examQuery){
        log.debug("后端开头");
        log.debug("查询考试:examQuery={}",examQuery);
        List<ExamVO> list = examService.selectExam(examQuery);
        log.debug("list={}",list);
        log.debug("接受数据");
        return JsonResult.ok(list);
    }


    /*@PostMapping("/update/password/{userId}")
    public JsonResult resetPassword(@PathVariable Long userId){
        log.debug("重置密码,userId={}",userId);
        userService.resetPassword(userId);
        return JsonResult.ok();
    }
    @PostMapping("/update/status/{userId}/{status}")
    public JsonResult updateStatus(@PathVariable Long userId,@PathVariable String status){
        log.debug("修改用户状态,userId={},status={}",userId,status);
        userService.updateStatus(userId,status);
        return JsonResult.ok();
    }

    @PostMapping("/delete/{userId}")
    public JsonResult deleteUser(@PathVariable Long userId){
        log.debug("删除用户,userId={}",userId);
        userService.deleteUser(userId);
        return JsonResult.ok();
    }

    @GetMapping("/select/audit/{parentId}")
    public JsonResult selectAuditList(@PathVariable Long parentId){
        log.debug("查询上级审批人列表:parentId={}",parentId);
        List<UserVO> list = userService.selectAuditList(parentId);
        return JsonResult.ok(list);
    }*/

}